<?php
/**
 * Created by PhpStorm.
 * User: admin
 * Date: 2020/1/13
 * Time: 16:26
 */

namespace app\api\model;


use think\Cookie;
use think\Model;

class User extends Model
{
    protected $table = "users";
    protected $insert = ["status"=>0,'create_ip','create_time','verify_sign'];

    protected function setCreateIpAttr(){
        return request()->ip();
    }

    protected function setVerifySignAttr(){
        return Cookie::get('verify_sign');
    }

    protected function setCreateTimeAttr(){
        return date("Y-m-d H:i:s",time());
    }

    //对密码的进行加密
    protected function setPasswordAttr($password){
        return md5('JG-2020'.md5($password));
    }

}